#include<bits/stdc++.h>
using namespace std;
char a[100000];
int main()
{
	int i,zimu=0,kong=0,shu=0,qi=0;
	gets(a);
	for(i=0;a[i]!='\0';i++)
	{
		if(('a'<=a[i]&&a[i]<='z')||('A'<=a[i]&&a[i]<='Z'))
		zimu++;
		else
		if(a[i]==' ') kong++;
		else
		if(48<=a[i]&&a[i]<=57) shu++;
		else
		qi++;
	}
	cout<<zimu<<endl<<kong<<endl<<shu<<endl<<qi;
    return 0;
}
